package demo1;

//牛客网:春游
//https://ac.nowcoder.com/acm/problem/219035
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        while (t-- > 0) {
            long n = scanner.nextInt();
            long a = scanner.nextInt();
            long b = scanner.nextInt();
            long ret = 0;
            if (n <= 2) {
                ret = Math.min(a, b);
            } else {
                if (3 * a < 2 * b) {
                    ret += (n / 2) * a;
                    if (n % 2 != 0) ret += Math.min(a, b - a);
                }else {
                    ret += (n/3) * b;
                    long k = n % 3;
                    if(k == 1) ret += Math.min(Math.min(a,b),2*a-b);
                    if(k == 2) ret += Math.min(Math.min(a,b),2*b-b);
                }
            }
            System.out.println(ret);
        }
    }
}


/*

//超时代码

import java.util.Scanner;


public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        while (t-- > 0) {
            long n = scanner.nextInt();
            long a = scanner.nextInt();
            long b = scanner.nextInt();
            long ret = Long.MAX_VALUE;
            for(long i = 0; i<=n/2+1; i++) {
                long j = (n - i*2)/3;
                if(i*2 + j*3 - n >= 3) {
                    j--;
                }
                if(i*2 + j*3 < n) {
                    j++;
                }
                ret = Math.min(ret,i*a+b*j);
            }
            System.out.println(ret);
        }
    }
}

 */
